Uninitialized memory reads (UMRs) are a common issue encountered by software programmers and often times difficult to track down. There are many situations where a UMR might be encountered, but ultimately a UMR is defined as a read from a location in memory that has not been initialized.
Some scenarios which might result in a UMR are read requests that:                Access a memory location that has been allocated, but has not yet been initialized.        Access locations that are beyond the end of an allocated block of memory.        Attempt to access a location that has not yet been allocated.        Access a location in memory that was previously allocated but subsequently freed (or reallocated and moved).        Access a random location in memory.        
An example in C of the scenario described above in “Access a memory location that has been allocated, but has not yet been initialized”:
struct umr_test { int  element;}void main ( ){ struct umr_test *pinst; pinst  =  (struct  umr_test  *)malloc (sizeof (structumr_test)); printf(“pinst->element  =  %d\n”,  pinst->element);// UMR occurs here return;}
Typically when one thinks of how UMRs occur they think of a processor executing an instruction sequence. It is important to note that a UMR can be the result of a read request by any master in a system, including DMAs, and peripherals.
One approach in the prior art is to establish a ‘watch’ at various locations in memory. Once a watch is established, it is assumed that the memory locations it is monitoring are uninitialized. Subsequent accesses to the watched memory locations are monitored with a ‘write’ causing the associated address to be treated as initialized. If a watch detects a read access to a location that is uninitialized, then the equivalent of a UMR is triggered.
The disadvantage of this approach is the reliance on hardware tracking the state of specific memory addresses or memory regions. This can result in a large amount of extra hardware, usually on the order of 1 register per address being watched.
In another approach known in the prior art reserved/unused encodings of a memory's ECC (Error Correction Codes) are used to detect UMRs. The ECCs within a memory are initialized by Built in Self Test (BIST) logic to a state that is defined to mean ‘uninitialized’. When a memory is written, the ECC will be overwritten with a setting different from the ‘uninitialized’ encoding. If a memory is read with an ECC value indicating that the memory has not yet been written then a breakpoint or interrupt will be generated. The disadvantage to this approach is that it is only functional with memories that support ECC.